<?php
header('Content-Type:text/html; charset=utf-8');
define('ROOT_DIR', dirname(dirname(__FILE__)) . '/');
require_once ROOT_DIR . 'Include/Config.php';
include_once( 'saet.ex.class.php' );
define('APP_HOST', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('TMP_PATH', SAE_TMP_PATH);
require_once ROOT_DIR . 'Libraries/Smarty/Smarty.class.php';
require_once ROOT_DIR . 'Libraries/Util.php';
require_once ROOT_DIR . 'Libraries/Db.php';

define('COOKIE_EXPIRE', 86400);

function __autoload($classname)
{
	$findPath = array(
		ROOT_DIR . 'Libraries/' . $classname . '.php',
		ROOT_DIR . 'Controllers/' . $classname . '.php',
		ROOT_DIR . 'Modules/' . $classname . '.php',
	);
	
	foreach ($findPath as $filename){
		if (file_exists($filename)){
			require_once $filename;
			return true;
		}
	}
	return false;
}